<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<header th:replace="admin/header::header-fragment"></header>
<link th:href="@{/admin/plugins/editormd/css/editormd.css}" rel="stylesheet"/>
<link th:href="@{/admin/plugins/tagsinput/jquery.tagsinput.css}" rel="stylesheet"/>
<link th:href="@{/admin/plugins/select2/select2.css}" rel="stylesheet"/>
<body class="hold-transition sidebar-mini">
<div class="wrapper">
    <!-- 引入页面头header-fragment -->
    <div th:replace="admin/header::header-nav"></div>
    <!-- 引入工具栏sidebar-fragment -->
    <div th:replace="admin/sidebar::sidebar-fragment(${path})"></div>
    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <div class="content-header">
            <div class="container-fluid">
            </div><!-- /.container-fluid -->
        </div>
        <!-- Main content -->
        <div class="content">
            <div class="container-fluid">
                <div class="card card-primary card-outline">
                    <div class="card-header">
                        <h3 class="card-title">成员管理</h3>
                    </div>
                    <div class="card-body">
                        <!-- 几个基础的输入框，名称、分类等输入框 -->
                        <form id="blogForm" onsubmit="return false;">
                            <div class="form-group" style="display:flex;">
                                <input type="hidden" id="memberId" name="memberId"
                                       th:value="${member!=null and member.id!=null }?${member.id}: 0">
                                <input type="text" class="form-control col-sm-6" id="memberName" name="memberName"
                                       placeholder="*请输入成员姓名(必填)"
                                       th:value="${member!=null and member.name!=null }?${member.name}: ''"
                                       required="true">

                                &nbsp;&nbsp;<select class="form-control select2" style="width: 100%;" id="degree"
                                                    data-placeholder="请选择分类...">
                                <th:block th:unless="${null == degree}">
                                    <th:block th:each="c : ${degree}">
                                        <!--                                        <option th:value="${c}" th:text="${c}"-->
                                        <!--                                                th:selected="${null !=member} ?true:false">-->
                                        <!--                                        </option>-->
                                        <option th:if="${c eq 'Professor'}" th:value="${c}" th:text="教授"
                                                th:selected="${null !=member and member.degree eq c} ?true:false"></option>
                                        <option th:if="${c eq 'Postdoctoral Fellow'}" th:value="${c}" th:text="博士后"
                                                th:selected="${null !=member and member.degree eq c} ?true:false"></option>
                                        <option th:if="${c eq 'PhD Student'}" th:value="${c}" th:text="博士"
                                                th:selected="${null !=member and member.degree eq c} ?true:false"></option>
                                        <option th:if="${c eq 'Postgraduate Student'}" th:value="${c}" th:text="研究生"
                                                th:selected="${null !=member and member.degree eq c} ?true:false"></option>
                                        <option th:if="${c eq 'Undergraduate'}" th:value="${c}" th:text="本科生"
                                                th:selected="${null !=member and member.degree eq c} ?true:false"></option>
                                        <option th:if="${c eq 'Alumni'}" th:value="${c}" th:text="毕业生"
                                                th:selected="${null !=member and member.degree eq c} ?true:false"></option>
                                    </th:block>
                                </th:block>
                            </select>

                            </div>
                            <div class="form-group" style="display:flex;">
                                <input type="text" class="form-control col-sm-6" id="subject"
                                       name="subject"
                                       th:value="${member!=null}?${member.subject}: ''"
                                       placeholder="研究方向"> &nbsp;&nbsp;

                            </div>
                            <div class="form-group" style="display:flex;">
                                <input type="text" class="form-control col-sm-6" id="introduction"
                                       name="introduction"
                                       th:value="${member!=null}?${member.introduction}: ''"
                                       placeholder="请用一句话描述自己(将显示在列表页照片下)"> &nbsp;&nbsp;

                            </div>
                            <div class="form-group">
                                <div class="col-sm-4">
                                    <th:block th:if="${null == member}">
                                        <img id="memberImg" src="/admin/dist/img/img-upload.png"
                                             style="height: 64px;width: 64px;">
                                    </th:block>
                                    <th:block th:unless="${null == member}">
                                        <img id="memberImg" th:src="${member.imgUrl}"
                                             style="width:160px ;height: 120px;display:block;">
                                    </th:block>
                                </div>
                            </div>
                            <br>
                            <div class="form-group">
                                <div class="col-sm-4">
                                    <button class="btn btn-info" style="margin-bottom: 5px;" id="uploadImage">
                                        <i class="fa fa-picture-o"></i>&nbsp;上传照片
                                    </button>

                                </div>
                            </div>
                            <div class="form-group" id="member-editormd">
                                <textarea style="display:none;"
                                          th:utext="${member}?${member.introductionDetail}: ''"></textarea>
                            </div>
                            <div class="form-group">
                                <!-- 按钮 -->
                                &nbsp;<button class="btn btn-info float-right" style="margin-left: 5px;"
                                              id="save">保存
                            </button>&nbsp;
                                &nbsp;<button class="btn btn-secondary float-right" style="margin-left: 5px;"
                                              id="cancelButton">返回成员列表页
                            </button>&nbsp;
                            </div>
                        </form>
                    </div>

                </div>
            </div><!-- /.container-fluid -->
        </div>

    </div>
    <!-- /.content-wrapper -->
    <!-- 引入页脚footer-fragment -->
    <div th:replace="admin/footer::footer-fragment"></div>
</div>
<!-- jQuery -->
<script th:src="@{/admin/plugins/jquery/jquery.min.js}"></script>
<!-- jQuery UI 1.11.4 -->
<script th:src="@{/admin/plugins/jQueryUI/jquery-ui.min.js}"></script>
<!-- Bootstrap 4 -->
<script th:src="@{/admin/plugins/bootstrap/js/bootstrap.bundle.min.js}"></script>
<!-- AdminLTE App -->
<script th:src="@{/admin/dist/js/adminlte.min.js}"></script>
<!-- editor.md -->
<script th:src="@{/admin/plugins/editormd/editormd.js}"></script>
<!-- tagsinput -->
<script th:src="@{/admin/plugins/tagsinput/jquery.tagsinput.min.js}"></script>
<!-- Select2 -->
<script th:src="@{/admin/plugins/select2/select2.full.min.js}"></script>
<!-- sweetalert -->
<script th:src="@{/admin/plugins/sweetalert/sweetalert.min.js}"></script>
<!-- ajaxupload -->
<script th:src="@{/admin/plugins/ajaxupload/ajaxupload.js}"></script>
<script th:src="@{/admin/dist/js/public.js}"></script>
<script th:src="@{/admin/dist/js/edit-member.js}"></script>
<!-- siderbar -->
<script th:src="@{/admin/dist/js/siderbar.js}"></script>
</body>
</html>
